package com.recruit.wechat;

import com.recruit.wechat.config.token.JwtUtils;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 2020/8/13
 * springboot启动类
 */
@MapperScan({"com.recruit.wechat.mapper"})
//扫描公共模块下的包     注入注解
@ComponentScan(basePackages = {"com.recruit.wechat"})
//@ServletComponentScan(value = "com.recruit.wechat.config")
@ComponentScan(basePackages = {"com.recruit.wechat.config","com.recruit.n3r.idworker"})
@SpringBootApplication
//启动缓存数据库
@EnableCaching
@EnableScheduling  //定时任务
@EnableAsync
@Slf4j
public class PayWeCahtServerApplication {

    public  static  void main(String [] args){
        log.info("Springboot启动中....");
        SpringApplication.run(PayWeCahtServerApplication.class,args);
        log.info("启动成功！");
    }

    @Bean
    public JwtUtils jwtUtils(){
        return new JwtUtils();
    }
}